package day02;

import java.lang.ref.SoftReference;

public class VarDemo {
    public static void main(String[] args) {
        Object obj = new Object();
        SoftReference softRef = new SoftReference<Object>(obj);//删除强引用
        obj = null;//调用gc
        System.gc();
        System.out.println("gc之后的值：" + softRef.get());

    }
}
